package com.tianpengtech.front.mobile.advertisement;

import com.tianpengtech.common.model.fairadvertisement.FairAdvertisement;
import com.tianpengtech.common.model.fairreport.FairReport;
import com.tianpengtech.front.mobile.common.util.R;

import java.util.List;

/**
 * Created by ggd on 2017/8/5 0005.
 */
public class MobileAdvertisementService {
    public static MobileAdvertisementService me = new MobileAdvertisementService();

    /**
     * 获取首页显示的广告信息
     * @return
     */
    public R index(){
        String sql =  String.format("select %s,%s,%s from %s where %s=? order by %s desc",FairAdvertisement.ID,FairAdvertisement.PICTURE,FairAdvertisement.URL,FairAdvertisement.dao.tableName(),FairAdvertisement.DELETETAG,FairAdvertisement.CREATE_TIME);
        List<FairAdvertisement> advs=FairAdvertisement.dao.find(sql,0);
        R r= R.ok();
        r.p("list",advs);
        return r;
    }
}
